Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

5.1K
Visualizações
React Native on Android: Cannot run program "node": error=2, No such file or directory

EDIT: I am uncertain which steps I took to resolve this problem, and am no longer seeing this error message so I cannot test the solutions below. Please try them individually as different answers seem to be working for different people.

The iOS version works fine, but running Android Studio on my Mac I get the following Gradle Build error (paraphrased):

:ReactNative:Running ‘[node, -e, console.log(require(‘react-native/cli’).bin);]’ command failed.

- Where:
Script ‘/Users/…/Desktop/…/node_modules/@react-native-community/cli-platform-android/native_modules.gradle’ line: 154

- What went wrong:
A problem occurred evaluating script.
> Cannot run program “node”: error=2, No such file or directory

Caused by: java.io.IOException: Cannot run program “node”: error=2, No such file or directory

I've tried so many things:

  • Following the React Native development set-up: https://reactnative.dev/docs/environment-setup
  • Following this advice about [renaming?] the node path: https://stackoverflow.com/a/54007652
  • Following this advice about symlink: https://stackoverflow.com/a/52779097
  • Ran brew install node. Message: node 14.2.0 is already installed, it’s just not linked. Tried to run brew link --overwrite node, error /usr/local/share/doc/node is not writable.
  • Tried to uninstall and reinstall all the package managers, node, yarn, whatever.

I used to be able to still run yarn android in Terminal, but even that has stopped working.

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

It's because android studio couldn't find node and should run through terminal.

If you are using Mac you can run Android studio using This command in terminal

1. Run this open -a /Applications/Android\ Studio.app

2. Then sync Gradle

And this will solve the problem.

over 4 years ago · Santiago Trujillo Relatório

0

Simply linking node (installed previously by nvm) to /usr/local/bin/node.

sudo ln -s "$(which node)" /usr/local/bin/node

Ubuntu 20.4, Node 14.15.0

over 4 years ago · Santiago Trujillo Relatório

0

In my case with this setup:

  • Apple chip M1
  • Android Studio arctic fox 2020.3.1 Patch 2

I previously ran the command mentioned above, but I kept getting the same error:

sudo ln -s "$(which node)" /usr/local/bin/node

I had to update the gradle version in the project (android/gradle/wrapper/gradle-wrapper.properties)

from:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

to:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip

and execute this command in the project:

cd android && ./gradlew clean

or just delete this folder instead of the executing the previous command: android/.gradle

And after doing these steps I no longer have any problem.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda